package edu.ynu.e_platform.dao;

import edu.ynu.e_platform.common.dao.LogicDAO;
import edu.ynu.e_platform.entities.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

/**
 * @author manwen Yang
 */
@Component
public interface UserDao extends LogicDAO<User, Long> {

    User findByUsernameAndPassword(String userName, String password);

    @Query(value = "select u from User u where u.id = :userId")
    User findUser(@Param("userId")Long userId);

    User findByUsername(String userName);
}
